/* 
 * File:   Rectangle.h
 * Author: mauro
 *
 * Created on 13 de octubre de 2014, 18:27
 */

#ifndef RECTANGLE_H
#define	RECTANGLE_H

#include "../Define/Structs.h"
#include "Object.h"
#include "ObjFactory.h"
#include "Dot.h"
#include "WorldElement.h"
#include <Box2D/Box2D.h>

class Rectangle : public WorldElement{
private:
    Object *object;
    Dot *dot;
    struct ObjectInit data;

    void updatePosition();
    void updateRotation();
    bool equals;
    
public:
       
    Rectangle();
    Rectangle(ObjFactory *objFactory,bool flagStatic, float x,float y,float w, float h, float mass, float rotation, int idImage);
    
    bool getAreEquals();
    
    void restartPlayer();
    
    void checkChanges();
    void updateData();
    struct ObjectInit getData();

    b2Vec2 getPosition();
    float getAngle();
    float getAngularVelocity();
    
    void setAngularVelocity(float velocity);
    void setUbicDyn(int i);

    void changeGroupIndex(int newGroup);    
    b2Body* getBody();
    virtual ~Rectangle();

};

#endif	/* RECTANGLE_H */

